package org.redis.cluster.redis.transport.codec.client;

import org.redis.cluster.redis.RedisCommand;
import org.redis.cluster.transport.protocol.ProtocolEncoder;

public class RedisClientProtocolEncoder implements ProtocolEncoder {

	@Override
	public byte[] encode(Object value) {
		if(value instanceof RedisCommand) {
			return ((RedisCommand)value).getSource(); 
		}
		
		if(value instanceof byte[]) {
			return ((byte[]) value);
		}
		
		return null;
	}

}